package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.ShopService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/shop")
@Slf4j
public class ShopController {
    @Autowired
    private ShopService shopService;

    @PutMapping("/{status}")
    public Result setShopStatus(@PathVariable Integer status){
        log.info("设置店铺营业状态：{}",status);
        shopService.setStatus(status);
        return Result.success("操作成功~");
    }

    @GetMapping("/status")
    public Result getShopStatus(){
        log.info("获取店铺营业状态：{}");
       Integer status =  shopService.getStatus();
        return Result.success(status);
    }
}
